package com.rew.canteenchefs.services.imp;

import com.rew.canteenchefs.managers.imp.EDishesManager;
import com.rew.canteenchefs.models.EDishes;
import com.rew.canteenchefs.models.Result;
import com.rew.canteenchefs.services.IEDishesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *  EDishesService.
 *
 * Created by HuiWen Ren on 2016/12/10.
 */
@Service
public class EDishesService implements IEDishesService{

    @Autowired
    EDishesManager dishesManager;

    /**
     * 插入菜品（后台用）.
     *
     * @param dishes 待插入菜品
     * @return 插入结果
     */
    @Override
    public Result<Integer> insertDishes(EDishes dishes) {
        return dishesManager.insertDishes(dishes);
    }

    /**
     * 查询菜品信息.
     *
     * @param dishName 菜品名称
     * @return 查询信息
     */
    @Override
    public Result<EDishes> selectDishes(String dishName){
        return dishesManager.selectDishes(dishName);
    }

    /**
     * 更新菜品信息.
     *
     * @param dishes 更新信息
     * @return 更新结果
     */
    @Override
    public Result<Integer> updateDishes(EDishes dishes) {
        return dishesManager.updateDishes(dishes);
    }

    /**
     * 菜品删除.
     *
     * @param dishName 菜品名称
     * @return 删除结果
     */
    @Override
    public Result<Integer> deleteDishes(String dishName) {
        return dishesManager.deleteDishes(dishName);
    }

}
